//package com.xiaoniu.mc;
//
//import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
//import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.Random;
//import java.util.concurrent.TimeUnit;
//
//
//@RestController
//public class McLabApplication {
//
//    @RequestMapping(value = "/user")
//
//    @HystrixCommand(
//            fallbackMethod = "fallback1", threadPoolProperties = {
//            @HystrixProperty(name = "coreSize", value = "5"),
//            @HystrixProperty(name = "maxQueueSize", value = "10"),
//            @HystrixProperty(name = "queueSizeRejectionThreshold", value = "5")}, commandProperties = {
//            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "500"),
//            @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "1")
//            //判断熔断的最少请求数，默认是10；只有在一个统计窗口内处理的请求数量达到这个阈值，才会进行熔断与否的判断
//    })
//    public String getUser1() throws InterruptedException {
//        int L = new Random().nextInt(2000);
//        TimeUnit.MILLISECONDS.sleep(L);
//        System.out.println(L);
//        return "good";
//    }
//
//    public String fallback1() {
//        System.out.println("FUCK");
//        return "fuck";
//    }
//}
